package com.juyu.miliao.api.controller;

import com.juyu.miliao.api.domain.vo.WarnManUserVo;
import com.juyu.miliao.api.service.WarnManUserService;
import com.juyu.miliao.common.domain.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 *  打招呼男性列表控制层
 * @Auther: 卜加超
 * @Date: 2019/2/21 17:18
 * @Description:
 */
@RestController
@RequestMapping("/warnManUser")
public class WarnManUserController {
    private static final Logger logger = LoggerFactory.getLogger(WarnManUserController.class);
    @Resource
    private WarnManUserService warnManUserService;

    @GetMapping
    public List<WarnManUserVo> getWarnManUser(Authentication token){
        Subject subject = (Subject) token.getPrincipal();
        List<WarnManUserVo> list = warnManUserService.getWarnManUser(subject.getId());
        return list;
    }
}
